# Symtable makefile

# Make sure we can clean on windows as well
ifdef SystemRoot
   RM = del /Q /F
   FPIC =
else
   ifeq ($(shell uname), Linux)
      RM = rm -f
      FPIC = -fPIC
   endif
endif

CXXFLAGS =	-O2 -Wall $(FPIC) -c
LDFLAGS =	-shared -Wl,-soname,libSymtable.so

SRC =		SymTable.cpp Storage.cpp StoreSymEntry.cpp StoreSymInfo.cpp SymEntry.cpp SymInfo.cpp Key.cpp
OBJS =		$(SRC:.cpp=.o)
INCS =		$(wildcard *.h)

LIBS =

TARGET =	libSymtable.so


$(TARGET):	$(OBJS)
	$(CXX) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)

%.o: %.cpp $(INCS)
	$(CXX) $(CXXFLAGS) $< -o $@

debug:	CXX += -DDEBUG -g
debug:	CC += -DDEBUG -g
debug:	all

release:	all

all:	$(SRC) $(TARGET)

.PHONY: clean
clean:
	$(RM) $(OBJS) $(TARGET)
